<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>jb-aptech毕业设计项目</TITLE>
<meta name="renderer" content="ie-comp">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="../css/style.css" rel="stylesheet" type="text/css">
<script src="../script/common.js"></script>
	<script src="../script/vue.js"></script>
	<script src="../script/jquery-3.3.1.min.js"></script>
</head>
<body>

<div id="app">
	<div class="page_title">产品查询</div>
	<div class="button_bar">
		<button class="common_button" onclick="help('');">帮助</button>
		<button class="common_button" @click.prevent="load()">查询</button>
	</div>
	<table class="query_form_table">
		<tr>
			<th>产品</th>
			<td><input v-model="storage.stk_prod_id"/></td>
			<th>仓库</th>
			<td><input v-model="storage.stk_warehouse"/></td>
			<th>&nbsp;</th>
			<td>&nbsp;</td>
		</tr>
	</table>
	<br />
	<table class="data_list_table">
		<tr>
			<th>序号</th>
			<th>产品</th>
			<th>仓库</th>
			<th>货位</th>
			<th>件数</th>
			<th>备注</th>
		</tr>
		<tr v-for="s in storages">
			<td class="list_data_number" v-text="s.stk_id">1</td>
			<td class="list_data_ltext" v-text="s.stk_prod_id">幸福牌电视机-818 FFT-2388 EA03</td>
			<td class="list_data_ltext" v-text="s.stk_warehouse">北京-西直门库</td>
			<td class="list_data_text" v-text="s.stk_ware">EC-D2</td>
			<td class="list_data_number" v-text="s.stk_count">16</td>
			<td class="list_data_ltext">&nbsp;</td>
		</tr>
		<tr>
			<th colspan="100" class="pager">
				<div class="pager">
					共<span v-text="pageInfo.total"></span>条记录 每页<input :value=pageInfo.pageSize size="2" />条
					第<input :value=pageInfo.pageNum size="2"/>页/共5页
					<a href="#">第一页</a>
					<a href="#" @click.prevent="load(pageInfo.pageNum-1)">上一页</a>
					<a href="#" @click.prevent="load(pageInfo.pageNum+1)">下一页</a>
					<a href="#">最后一页</a>
					转到<input value="1" size="2" />页
					<button width="20" onclick="reload();">GO</button>
				</div>
			</th>
		</tr>
	</table>
</div>
<script>
	const vm = new Vue({
		el:'#app',
		data:{
			storages:[],
			pageInfo:{},
			storage:{
				stk_id:'',
				stk_prod_id:'',
				stk_warehouse:'',
				stk_ware:'',
				stk_count:'',
				pageNum:1,
				pageSize: 5,
			}
		},methods:{
			load(num){
				this.storage.pageNum=num;
				$.getJSON("/Storage/queryPage",this.storage,json=>{
					this.storages=json.data.pageInfo.list;
					this.pageInfo=json.data.pageInfo;
				})
			}
		},mounted(){
			this.load();
		}
	})
</script>
</body>
</html>